import { defineConfig } from 'vite'
import uni from '@dcloudio/vite-plugin-uni'
import fs from 'fs';
import path from 'path';
const url = "http://192.168.31.248";
export default defineConfig({
  plugins: [
    uni(),
  ],
  server: {
    // 浏览器本地开发代理配置
    proxy: {
      "/api": {
        target: url + ":8081",
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, "/")
      },
      "/sseApi": {
        target:  url + ":9000",
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/sseApi/, "/")
      },

      "/payApi": {
        target:  url + ":8081",
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/payApi/, "/")
      },
    },
  },
})
